package pers.lan.array;

import java.util.Arrays;

/**
 * @author <p><a href="mailto:1728209643@qq.com">XiaoSan</a>
 * @date 2019/9/23 3:51 PM
 */
public class LC_LCP2 {

    public static void main(String[] args) {
        System.out.println(
                Arrays.toString(fraction(new int[]{3, 2, 0, 2}))
        );
    }

    public static int[] fraction(int[] cont) {
        int[] res = new int[2];
        res[0] = 1;
        for(int i = cont.length - 1; i >= 0; i--){
            int temp1 = res[1];
            res[1] = res[0];
            res[0] = cont[i] * res[1] + temp1;
        }
        return res;
    }

}
